import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:travel/screen/flutter_screenutil.dart';
import 'package:travel/utils/colors.dart';
import 'package:travel/utils/styles.dart';
import 'package:url_launcher/url_launcher.dart';

class IntroduceController extends GetxController {
  RxInt tabIndex = 0.obs;

  RxDouble width = 115.0.obs;

  RxList<String> tabs = RxList(['景区介绍', '入园信息', '游玩指南']);

  ScrollController scrollController = ScrollController();

  GlobalKey appBarKey = GlobalKey();

  List<GlobalKey> tabsKey = [];

  List<double> boxPos = [];

  RxBool isLoading = true.obs;

  @override
  void onInit() {
    super.onInit();
    for (var e in tabs) {
      tabsKey.add(GlobalKey(debugLabel: 'introduce-$e'));
    }
    scrollController.addListener(() {
      if (isLoading.isTrue) {
        var index = createIndex(scrollController.offset);
        if (index != tabIndex.value) {
          tabIndex.value = index;
        }
      }
    });
  }

  @override
  void onReady() {
    super.onReady();
    List<double> pos = [];
    for (var i = 0; i < tabsKey.length; i++) {
      double cardOffset =
          (tabsKey[i].currentContext!.findRenderObject() as RenderBox)

              ///相对于原点 控件的位置
              .localToGlobal(Offset.zero)

              ///y点坐标
              .dy;
      pos.add(cardOffset);
    }
    boxPos = pos;
  }

  @override
  void onClose() {
    super.onClose();
    scrollController.dispose();
  }

  int createIndex(double offset) {
    Size? size = appBarKey.currentContext?.size;
    var dy = size?.height ?? 0;
    for (var i = 1; i < boxPos.length; i++) {
      if (boxPos[i] > offset + dy) {
        return i;
      }
    }
    return 0;
  }
}

class IntroduceView extends GetView<IntroduceController> {
  const IntroduceView({super.key});

  PreferredSize get bottom {
    var pad = (Get.width - controller.width.value * controller.tabs.length) / 2;
    return PreferredSize(
      preferredSize: Size.fromHeight(35.h),
      child: Container(
        decoration: const BoxDecoration(color: Colors.white),
        padding: EdgeInsets.symmetric(horizontal: pad),
        child: Stack(
          children: [
            SizedBox(
              height: 35.h,
              child: Row(
                children: controller.tabs
                    .asMap()
                    .map((index, e) => MapEntry(
                        index,
                        Expanded(
                            child: InkWell(
                          onTap: () {
                            controller.isLoading.value = false;
                            controller.tabIndex.value = index;
                            final keyRenderObject = controller
                                .tabsKey[index].currentContext
                                ?.findAncestorRenderObjectOfType();
                            controller.scrollController.position
                                .ensureVisible(keyRenderObject!,
                                    duration: const Duration(milliseconds: 300),
                                    curve: Curves.linear)
                                .then((value) =>
                                    controller.isLoading.value = true);
                          },
                          child: Center(
                            child: Text(e, style: getActiveStyle(index)),
                          ),
                        ))))
                    .values
                    .toList(),
              ),
            ),
            AnimatedPositioned(
              width: controller.width.value,
              height: 2,
              bottom: 0,
              left: controller.tabIndex.value * controller.width.value,
              duration: const Duration(milliseconds: 100),
              child: Container(
                width: controller.width.value,
                height: 2,
                decoration: BoxDecoration(
                    color: ColorsUtils.parseColorFromHexString(
                        ColorsUtils.color3478)),
              ),
            )
          ],
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Obx(() => Scaffold(
          backgroundColor: Colors.white,
          appBar: AppBar(
            key: controller.appBarKey,
            automaticallyImplyLeading: true,
            leading: InkWell(
              onTap: () {
                Get.back();
              },
              child: Icon(
                Icons.arrow_back_ios,
                color:
                    ColorsUtils.parseColorFromHexString(ColorsUtils.color3333),
                size: 20.w,
              ),
            ),
            leadingWidth: 40.w,
            title: Text(
              '故宫博物馆',
              style: StylesUtils.customTextStyle(
                  fontSize: 18.sp, color: ColorsUtils.color0000),
            ),
            actions: [
              IconButton(
                icon: Icon(
                  Icons.share,
                  color: ColorsUtils.parseColorFromHexString(
                      ColorsUtils.color3333),
                ),
                onPressed: () async {
                  // int? index = await ToolsUtils.openShare(context);
                },
              ),
            ],
            bottom: bottom,
          ),
          body: CustomScrollView(
            controller: controller.scrollController,
            slivers: [
              SliverToBoxAdapter(
                child: Container(
                  key: controller.tabsKey[0],
                  padding:
                      EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
                  child: Column(
                    children: [
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 15.h),
                        child: Text(
                          '景区介绍',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 20.h),
                        child: Text(
                          '故宫是中国乃至世界上保存较为完整、规模较大的木质结构古建筑群。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 20.h),
                        child: Text(
                          '这些金碧辉煌的建筑群可以分为“外朝”与“内廷”两大部分。以乾清门为界，乾清门以南为外朝，是皇帝处理政务的地方，乾清门以北为内廷，住着后宫嫔妃，是皇帝家庭生活之所。走过金銮殿、乾清宫、坤宁宫，在皇帝的御花园里赏弄花花草草，感觉好像穿越到了古装剧里。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '故宫内珍藏有大量珍贵文物，据统计有上百万件。以文物的种类不同，分为多个展馆。其中珍宝馆和钟表馆很是引人注目，钟表馆每天11点和14点有钟表演示，可以看到清王朝珍藏的各种造型奇特的珍奇机械钟表，一定令你眼界大开。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              SliverToBoxAdapter(
                child: Container(
                  key: controller.tabsKey[1],
                  padding:
                      EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
                  child: Column(
                    children: [
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 15.h),
                        child: Text(
                          '入园信息',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 10.h),
                        child: Text(
                          '开放时间',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Table(
                        children: [
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '周一不开放',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              decoration: BoxDecoration(
                                  color: ColorsUtils.parseColorFromHexString(
                                      ColorsUtils.colorEfef)),
                              child: Text(
                                '4月1日-10月31日',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '周二至周日 08:30-17:00(最晚入园16:10)',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              decoration: BoxDecoration(
                                  color: ColorsUtils.parseColorFromHexString(
                                      ColorsUtils.colorEfef)),
                              child: Text(
                                '清明节，劳动节，端午节，中秋节，国庆节',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '07:30-17:00(最晚入园16:10)',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              decoration: BoxDecoration(
                                  color: ColorsUtils.parseColorFromHexString(
                                      ColorsUtils.colorEfef)),
                              child: Text(
                                '元旦节，春节',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              height: 40.h,
                              padding: EdgeInsets.only(left: 15.w),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '08:30-16:30(最晚入园15:40)',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 15.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ))
                          ]),
                        ],
                        border: TableBorder.all(
                            color:
                                ColorsUtils.parseColorFromHexString('#E4E4E4')),
                      ),
                      Container(
                        margin: EdgeInsets.only(top: 10.h),
                        decoration: BoxDecoration(
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorEfef)),
                        padding: EdgeInsets.symmetric(
                            vertical: 2.h, horizontal: 15.w),
                        child: Text(
                          '法定节假日周一不闭馆；停止入园时间含钟表馆、珍宝馆',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color6666,
                              fontSize: 13.sp,
                              lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(top: 15.h, bottom: 10.h),
                        child: Text(
                          '优待政策',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp,
                              fontWeight: FontWeight.w700,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Table(
                        border: TableBorder.all(
                            color:
                                ColorsUtils.parseColorFromHexString('#E4E4E4')),
                        columnWidths: const {
                          0: FixedColumnWidth(85),
                          1: FlexColumnWidth(),
                          2: FixedColumnWidth(85),
                        },
                        defaultVerticalAlignment:
                            TableCellVerticalAlignment.middle,
                        textDirection: TextDirection.ltr,
                        children: [
                          TableRow(
                              decoration: BoxDecoration(
                                  color: ColorsUtils.parseColorFromHexString(
                                      ColorsUtils.colorEfef)),
                              children: [
                                TableCell(
                                    child: Container(
                                  height: 40.h,
                                  alignment: Alignment.center,
                                  child: Text(
                                    '使用人群',
                                    style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color3333),
                                  ),
                                )),
                                TableCell(
                                    child: Container(
                                  alignment: Alignment.center,
                                  child: Text(
                                    '使用条件',
                                    style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color3333),
                                  ),
                                )),
                                TableCell(
                                    child: Container(
                                  alignment: Alignment.center,
                                  child: Text(
                                    '优待政策',
                                    style: StylesUtils.customTextStyle(
                                        color: ColorsUtils.color3333),
                                  ),
                                )),
                              ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '未成年人',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '18岁（不含）以下（有监护人陪同），需提前至官网预约',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '免费',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '未成年人',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '18岁（不含）以下（有监护人陪同），需提前至官网预约',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '免费',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '老人',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '60周岁（含）以上',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '优惠',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '学生',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '大学生（含港、澳、台学生；不含成人教育、研究生）凭学生证或学校介绍信可购买学生/儿童票',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '优惠',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '残疾人',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '凭残疾人证件',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '免费',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '军人',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '“八一”建军节，现役军人凭有效证件',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '免费',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '离休干部',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '凭离休证',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '免费',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '低保人员',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '持有北京市城乡居民最低生活保障金领取证的人员凭有效证件',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '半价',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ]),
                          TableRow(children: [
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '女性',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              padding: EdgeInsets.all(10.w),
                              child: Text(
                                '三八”妇女节，女性观众享受',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    lineHeight: 1.2.h),
                              ),
                            )),
                            TableCell(
                                child: Container(
                              alignment: Alignment.center,
                              child: Text(
                                '半价',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333),
                              ),
                            )),
                          ])
                        ],
                      )
                    ],
                  ),
                ),
              ),
              SliverToBoxAdapter(
                child: Container(
                  key: controller.tabsKey[2],
                  padding:
                      EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
                  child: Column(
                    children: [
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 15.h),
                        child: Text(
                          '游玩指南',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 15.h),
                        child: Text(
                          '官方电话',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 15.h),
                        child: TextButton(
                            onPressed: () async {
                              bool result = await canLaunchUrl(
                                  Uri(scheme: 'tel', path: '4009501925'));
                              printInfo(info: 'result = $result');
                            },
                            child: Text(
                              '4009501925',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color6799,
                                  fontSize: 13.sp),
                            )),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 10.h),
                        child: Text(
                          '必看贴士',
                          style: StylesUtils.customTextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.bold,
                              color: ColorsUtils.color3333),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '1. 购票指南：故宫门票全部在官网提前十天预售，现场已不设购票窗口，全部网络购票，实名制购票。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '2. 参观路线：故宫需由南到北参观，午门为唯一入口，出口为神武门和东华门。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '3. 导游服务：如果想深入了解故宫历史，可以租借语音讲解器或雇请讲解员。讲解器有20、40元两种，讲解员服务全程250元，中、西路150元，中路100元，若人数超过五人需加收10元/人。珍宝馆、钟表馆、书画馆等展馆内提供免费的汉语、英语讲解。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '4. 免费存包：故宫提供免费存包服务。寄存的包裹在午门和神武门之间传送（就是说：你可以在午门入口存包，在神武门出口取包）。存包处工作时间8:30-18:00。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '5. 周边景点：游览结束，从神武门出来后，对面即是景山公园。即可步行游览景山公园，或向西600米抵达北海公园。',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.5.h),
                        ),
                      ),
                    ],
                  ),
                ),
              )
            ],
          ),
        ));
  }

  TextStyle getActiveStyle(int index) {
    if (controller.tabIndex.value == index) {
      return StylesUtils.customTextStyle(
          fontSize: 15.sp,
          fontWeight: FontWeight.bold,
          color: ColorsUtils.color0000);
    }
    return StylesUtils.customTextStyle(
        fontSize: 15.sp, color: ColorsUtils.color5555);
  }
}
